<?php 
namespace app\components\actions;
use yii;
use yii\base\Action;

class CreateAction extends Action
{
     public  $model;
     public  $success;
     public  $renderFile='create';
     public  function  run(){

      $model= new $this->model;

        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            return call_user_func($this->success,$model);
        } else {
            return $this->controller->render($this->renderFile, [
                'model' => $model,
            ]);
        }
     }
   

} 




